<template>
  <div id="app">
    <header class="header">
      <h1>经营分析平台</h1>
    </header>
    <div class="container">
      <el-menu :default-active="path === '/' ? '/upload' : path" class="menu" :router="true">
        <el-menu-item index="/upload">客户端上传</el-menu-item>
        <el-menu-item index="/nowDownload">客户端最新下载地址</el-menu-item>
        <el-menu-item index="/apiBack">API备份</el-menu-item>
      </el-menu>
      <div class="content">
        <router-view></router-view>
      </div>
    </div>
     
  </div>
</template>

<script>
export default {
  name: 'app',
  data() {
      return {
        path: location.hash.split('#')[1]
      };
    }
}
</script>

<style>

* {
  margin: 0;
  padding: 0;
}

#app {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.header {
  background: #324157;
  color: #fff;
  height: 50px;
  text-align: center;
}

.container {
  display: flex;
  flex: 1;
}

.content {
  padding: 20px;
  width: 100%;
}

.menu {
  flex: 0 0 13em;
  order: -1;
}

</style>